package com.ww.companyCabinetSystem.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.ww.companyCabinetSystem.dao.INewproductsDao;
import com.ww.companyCabinetSystem.model.bo.MNewproductsBo;
import com.ww.companyCabinetSystem.utils.BeanUtils;
import com.ww.keyIdAutomaticGeneration.factory.KeyIdGenerationFactory;
@Component("newproducts")
public class NewproductsDaoImpl extends BaseDaoImpl implements INewproductsDao {

	@Override
	public boolean insertNewproducts(MNewproductsBo bo) {
		String keyId = KeyIdGenerationFactory.createKeyId();
		bo.setKeyId(keyId);
		BeanUtils.notNull(bo);
		return this.sqlSession.insert("com.ww.companyCabinetSystem.dao.INewproductsDao.insertNewproducts",
				bo)>0;
	}

	@Override
	public boolean updateNewproducts(MNewproductsBo bo) {
		// TODO Auto-generated method stub
		return this.sqlSession.update("com.ww.companyCabinetSystem.dao.INewproductsDao.updateNewproducts",
				bo)>0;
	}

	@Override
	public List<MNewproductsBo> selectByConfitions(MNewproductsBo bo) {
		// TODO Auto-generated method stub
		return this.sqlSession.selectList("com.ww.companyCabinetSystem.dao.INewproductsDao.selectNewproducts",
				bo);
	}

}
